<template>
	<view>
		<!-- 提示信息弹窗 -->
		<uni-popup ref="message" type="message" class="popup">
			<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		name:"popup",
		data() {
			return {
				msgType:"",
				messageText:"",
			};
		},
		methods:{
			// 弹出层提示
			_popError(errorText){
				this.msgType = "error";
				this.messageText = errorText;
				this.$refs.message.open();
			},
			_popWarn(warnText){
				this.msgType = "warn";
				this.messageText = warnText;
				this.$refs.message.open();
			},
			_popSuccess(successText){
				this.msgType = "success";
				this.messageText = successText;
				this.$refs.message.open();
			},
		}
	}
</script>

<style lang="scss">
	.popup{
		z-index: 999;
	}
</style>
